.PHONY: migrate-up migrate-down create-mysql start-mysql run see-mysql install-migration mysql-latest

create-mysql:
	sudo docker run --name PAYMENTS -p 53306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:latest

start-mysql:
	sudo docker start PAYMENTS

migrate-create:
	migrate create -ext sql -dir migrations -seq init_schema

migrate-up:
	migrate -path migrations -database "mysql://root:root@tcp(localhost:53306)/payments?" -verbose up 

migrate-down:
	migrate -path migrations -database "mysql://root:root@tcp(localhost:53306)/payments?" -verbose down

see-mysql:
	sudo docker exec -it PAYMENTS mysql -u root -p

run:
	go run main.go  injection.go data_sources.go

install-migration:
	curl -L https://github.com/golang-migrate/migrate/releases/download/v4.14.1/migrate.linux-amd64.tar.gz | tar xvz

mysql-latest:
	sudo docker pull mysql